project(${PROJECT_NAME})

set(EXECUTABLE_OUTPUT_PATH ${ROOT_PATH}/Sample-bin)
include_directories(${ROOT_PATH}/Source)
link_directories(${LIBRARY_OUTPUT_PATH})

if(BUILD_SHARED)
    add_definitions(-DMkCoreImport=1)
    set(MK_LIB ${PROJECT_NAME}-shared)
else()
    set(MK_LIB ${PROJECT_NAME}-static)
endif()

add_executable(SampleTimer ${CMAKE_CURRENT_LIST_DIR}/MkSampleTimer.cpp)
target_link_libraries(SampleTimer ${MK_LIB} ${LIBS})
add_dependencies(SampleTimer ${MK_LIB})
add_executable(SampleTcpServer ${CMAKE_CURRENT_LIST_DIR}/MkSampleTcpServer.cpp)
add_executable(SampleTcpClient ${CMAKE_CURRENT_LIST_DIR}/MkSampleTcpClient.cpp)
add_executable(SamplePipe ${CMAKE_CURRENT_LIST_DIR}/MkSamplePipe.cpp)
target_link_libraries(SampleTcpServer ${MK_LIB} ${LIBS})
add_dependencies(SampleTcpServer ${MK_LIB})
target_link_libraries(SampleTcpClient ${MK_LIB} ${LIBS})
add_dependencies(SampleTcpClient ${MK_LIB})
target_link_libraries(SamplePipe ${MK_LIB} ${LIBS})
add_dependencies(SamplePipe ${MK_LIB})



add_executable(SampleHttpApiServer ${CMAKE_CURRENT_LIST_DIR}/MkSampleHttpApiServer.cpp
								 ${CMAKE_CURRENT_LIST_DIR}/MkSampleHttpApiServer.h)
target_link_libraries(SampleHttpApiServer ${MK_LIB} ${LIBS})
add_dependencies(SampleHttpApiServer ${MK_LIB})



add_executable(SampleHttpHooker ${CMAKE_CURRENT_LIST_DIR}/MkSampleHooker.cpp)
target_link_libraries(SampleHttpHooker ${MK_LIB} ${LIBS})
add_dependencies(SampleHttpHooker ${MK_LIB})

add_executable(SampleHttpClientPool ${CMAKE_CURRENT_LIST_DIR}/MkSampleHttpClientPool.cpp)
target_link_libraries(SampleHttpClientPool ${MK_LIB} ${LIBS})
add_dependencies(SampleHttpClientPool ${MK_LIB})





#add_executable(HttpMessage ${CMAKE_CURRENT_LIST_DIR}/HttpMessage.cpp)
#add_executable(HttpServer ${CMAKE_CURRENT_LIST_DIR}/HttpServer.cpp
#                          ${CMAKE_CURRENT_LIST_DIR}/HttpServer.cpp
#                          ${CMAKE_CURRENT_LIST_DIR}/HttpServer.h)
#add_executable(HttpClient ${CMAKE_CURRENT_LIST_DIR}/HttpClient.cpp)
#target_link_libraries(HttpMessage ${MK_LIB} ${LIBS})
#add_dependencies(HttpMessage ${MK_LIB})
#target_link_libraries(HttpServer ${MK_LIB} ${LIBS})
#add_dependencies(HttpServer ${MK_LIB})
#target_link_libraries(HttpClient ${MK_LIB} ${LIBS})
# add_dependencies(HttpClient ${MK_LIB})
add_executable(SampleWebSocketClient ${CMAKE_CURRENT_LIST_DIR}/MkSampleWebSocketClient.cpp)
target_link_libraries(SampleWebSocketClient ${MK_LIB} ${LIBS})
add_dependencies(SampleWebSocketClient ${MK_LIB})

add_executable(SampleHttpClient ${CMAKE_CURRENT_LIST_DIR}/MkSampleHttpClient.cpp)
target_link_libraries(SampleHttpClient ${MK_LIB} ${LIBS})
add_dependencies(SampleHttpClient ${MK_LIB})



add_executable(SampleRtp ${CMAKE_CURRENT_LIST_DIR}/MkSampleRtp.cpp)
target_link_libraries(SampleRtp ${MK_LIB} ${LIBS})
add_dependencies(SampleRtp ${MK_LIB})



add_executable(SampleRtspPlayer ${CMAKE_CURRENT_LIST_DIR}/MkSampleRtspPlayer.cpp)
target_link_libraries(SampleRtspPlayer ${MK_LIB} ${LIBS})
add_dependencies(SampleRtspPlayer ${MK_LIB})
add_executable(SampleRtspServer ${CMAKE_CURRENT_LIST_DIR}/MkSampleRtspServer.cpp)
target_link_libraries(SampleRtspServer ${MK_LIB} ${LIBS})
add_dependencies(SampleRtspServer ${MK_LIB})
add_executable(SampleRtspPublisher ${CMAKE_CURRENT_LIST_DIR}/MkSampleRtspPublisher.cpp)
target_link_libraries(SampleRtspPublisher ${MK_LIB} ${LIBS})
add_dependencies(SampleRtspPublisher ${MK_LIB})

add_executable(SampleRtmpPusher ${CMAKE_CURRENT_LIST_DIR}/MkSampleRtmpPush.cpp)
target_link_libraries(SampleRtmpPusher ${MK_LIB} ${LIBS})
add_dependencies(SampleRtmpPusher ${MK_LIB})

add_executable(SampleRtmpPlayer ${CMAKE_CURRENT_LIST_DIR}/MkSampleRtmpPlayer.cpp)
target_link_libraries(SampleRtmpPlayer ${MK_LIB} ${LIBS})
add_dependencies(SampleRtmpPlayer ${MK_LIB})


add_executable(SampleFlv ${CMAKE_CURRENT_LIST_DIR}/MkSampleFlv.cpp)
target_link_libraries(SampleFlv ${MK_LIB} ${LIBS})
add_dependencies(SampleFlv ${MK_LIB})

add_executable(SamplePs ${CMAKE_CURRENT_LIST_DIR}/MkSamplePs.cpp)
target_link_libraries(SamplePs ${MK_LIB} ${LIBS})
add_dependencies(SamplePs ${MK_LIB})

add_executable(SampleGbLow ${CMAKE_CURRENT_LIST_DIR}/MkSampleGbLowSvr.cpp)
add_executable(SampleGbUp ${CMAKE_CURRENT_LIST_DIR}/MkSampleGbUpSvr.cpp)
add_executable(SampleGbDevice ${CMAKE_CURRENT_LIST_DIR}/MkSampleGbDevice.cpp ${CMAKE_CURRENT_LIST_DIR}/MkSampleGbDevice.h ${CMAKE_CURRENT_LIST_DIR}/MkSampleGbDeviceMain.cpp)
target_link_libraries(SampleGbLow ${MK_LIB} ${LIBS})
target_link_libraries(SampleGbUp ${MK_LIB} ${LIBS})
target_link_libraries(SampleGbDevice ${MK_LIB} ${LIBS})
add_dependencies(SampleGbLow ${MK_LIB})
add_dependencies(SampleGbUp ${MK_LIB})
add_dependencies(SampleGbDevice ${MK_LIB})

add_executable(SampleStateGridAUp ${CMAKE_CURRENT_LIST_DIR}/MkSampleStateGridAUp.cpp)
target_link_libraries(SampleStateGridAUp ${MK_LIB} ${LIBS})
add_dependencies(SampleStateGridAUp ${MK_LIB})

add_executable(SampleStateGridALow ${CMAKE_CURRENT_LIST_DIR}/MkSampleStateGridALow.cpp)
target_link_libraries(SampleStateGridALow ${MK_LIB} ${LIBS})
add_dependencies(SampleStateGridALow ${MK_LIB})

add_executable(SampleStateGridBSvr ${CMAKE_CURRENT_LIST_DIR}/MkSampleStateGridBSvr.cpp)
target_link_libraries(SampleStateGridBSvr ${MK_LIB} ${LIBS})
add_dependencies(SampleStateGridBSvr ${MK_LIB})

add_executable(SampleStateGridBClient ${CMAKE_CURRENT_LIST_DIR}/MkSampleStateGridBClient.cpp)
target_link_libraries(SampleStateGridBClient ${MK_LIB} ${LIBS})
add_dependencies(SampleStateGridBClient ${MK_LIB})

add_executable(SampleWsFlvClient ${CMAKE_CURRENT_LIST_DIR}/MkSampleWsFlvClient.cpp)
target_link_libraries(SampleWsFlvClient ${MK_LIB} ${LIBS})
add_dependencies(SampleWsFlvClient ${MK_LIB})
add_executable(SampleHttpMediaServer ${CMAKE_CURRENT_LIST_DIR}/MkSampleHttpMediaServer.cpp)
target_link_libraries(SampleHttpMediaServer ${MK_LIB} ${LIBS})
add_dependencies(SampleHttpMediaServer ${MK_LIB})

add_executable(SampleGbMediaServer ${CMAKE_CURRENT_LIST_DIR}/MkSampleGbMediaServer.cpp)
target_link_libraries(SampleGbMediaServer ${MK_LIB} ${LIBS})
add_dependencies(SampleGbMediaServer ${MK_LIB})

add_executable(SampleGbMediaEndUser ${CMAKE_CURRENT_LIST_DIR}/MkSampleGbMediaEndUser.cpp)
target_link_libraries(SampleGbMediaEndUser ${MK_LIB} ${LIBS})
add_dependencies(SampleGbMediaEndUser ${MK_LIB})
